package hbase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;



public class update {
    public static String update(String tablename, String info,String studentID,String change1,String change2) throws IOException {
        Configuration conf= HBaseConfiguration.create();
        conf.set("hbase.zookeeper.quorum","192.168.43.100");

        HTable h1=new HTable(conf,tablename);
        Put p=new Put(Bytes.toBytes(studentID));
        p.add(Bytes.toBytes(info),Bytes.toBytes(change1),Bytes.toBytes(change2));
        h1.put(p);
        h1.close();
        return "sucess！";

    }

}
